package rootpackege.spring.controller;

import javax.mail.MessagingException;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import rootpackege.spring.service.MailService;

@Controller
@RequestMapping("/mail")
public class SendMailContoller {
	@Autowired
	MailService mailService;
	
	@RequestMapping(value= "/sendMail" )
	public void sendMail(){
		String to = "xxxxxxxxx@qq.com"; // 
		String from = "aaaaaaaaa@qq.com";
		try {
			mailService.sendImgMail(from, to);
		} catch (MessagingException e) {
			e.printStackTrace();
		}
		
		
	}
}
